FROM golang:1.18.4 AS go_builder

ENV GO111MODULE=on \
    CGO_ENABLED=0 \
    GOOS=linux \
    GOARCH=amd64

WORKDIR /app
COPY . .
RUN go build -o httpserver .

FROM alpine
COPY --from=go_builder /app/httpserver /httpserver
EXPOSE 80
ENTRYPOINT ["/httpserver"]